home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Tool Chest / QuickDraw / Virtual Sphere 1.0.1 / Virtual Sphere Sample Code 1.1 / MyMath.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-25  |  1.8 KB  |  68 lines  |  [TEXT/MPS ]

  1. /*•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  2. /* MyMath.h
  3. /*
  4. /* Header file to hide all the ugliness when using floating point and fixed point
  5. /* math between MPW C and Think C.  Instead of figuring out when to and when
  6. /* not to include SANE.h and Math.h, and their order, just include MyMath.h.
  7. /*
  8. /* Author: Michael Chen, Human Interface Group / ATG
  9. /* Copyright © 1991-1993 Apple Computer, Inc.  All rights reserved.
  10. /*
  11. /* Part of Virtual Sphere Sample Code Release v1.1
  12. /*•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
  13.  
  14. #ifndef __MyMath__
  15. #define __MyMath__
  16.  
  17. #ifndef __GLOBALS__
  18. #include "Globals.h"
  19. #endif
  20.  
  21. #define Real    double
  22.  
  23.  
  24. /*=================================================================================================
  25. /* LightSpeed C dependencies
  26. /*-------------------------------------------------------------------------------------------------*/
  27. #ifdef THINK_C
  28.  
  29. #if __option(mc68881)
  30.     #ifndef  _MATH_
  31.     #include "Math.h"
  32.     #endif
  33.     
  34.     pascal    Fixed    Real2Fix (Real a);
  35.     pascal    Real    Fix2Real (Fixed a);
  36. #else
  37.     #ifndef  _SANE_
  38.     #include "SANE.h"
  39.     #endif
  40.     /* Don't include Math.h or you will be sorry! */
  41.     
  42.     #define    Real2Fix    X2Fix
  43.     #define    Fix2Real    Fix2X
  44.     pascal    Real asin (Real x);
  45.     pascal    Real atan2 (Real y, Real x);
  46. #endif
  47.  
  48. #endif THINK_C
  49.  
  50.  
  51. /*=================================================================================================
  52. /* MPW C dependencies
  53. /* MPW C is nice because the math libraries takes care of the different math format.
  54. /*-------------------------------------------------------------------------------------------------*/
  55. #ifdef applec
  56.  
  57. #ifndef _SANE_
  58. #include "SANE.h"
  59. #endif
  60.  
  61. #define    Real2Fix    X2Fix
  62. #define    Fix2Real    Fix2X
  63.  
  64. #endif applec
  65.  
  66.  
  67.  
  68. #endif __MyMath__